<?php
$sql = "SELECT * FROM #__content WHERE state=1 AND sectionid=1 AND price_giam>0 ORDER BY ordering ASC, id DESC LIMIT 0,5";
$database->setQuery($sql);
$lsSale = $database->loadObjectList();
?>
<div class="box">
	<div class="title">
		<div class="left"></div>
		<div class="center">Sản phẩm giảm giá</div>
		<div class="right"></div>
	</div>
	<div class="boxContent">
		<?php for ($i=0; $i<count($lsSale); $i++){?>
		<?php
		$url = $mosConfig_live_site."/administrator/components/com_content/uploads/";
		if ($lsSale[$i]->img!=''){
			$image = $url.$lsSale[$i]->img;
		}else{
			$image = $url.'no_pic.gif';
		}	 
		$link = sefRelToAbs("index.php?option=com_content&task=view&sectionid=".$lsSale[$i]->sectionid."&catid=".$lsSale[$i]->catid."&id=".$lsSale[$i]->id).$lsSale[$i]->title_alias.".html";
		?>
		<div class="boxproduct">
			<div class="image"><a href="<?php echo $link;?>"><img src="<?php echo $image;?>" border="0" /></a></div>
			<div class="field"><a href="<?php echo $link;?>"><?php echo $lsSale[$i]->title;?></a></div>
			<div class="price">Giá : <?php echo number_format($lsSale[$i]->price_giam,0,',','.');?> VNĐ</div>
		</div>
		<?php }?>
	</div>
</div>